how to remove all characters from a string in python

33

how to remove all characters from a string in python -

s = 'abc12321cba'

print(s.replace('a', ''))

drop all characters after a character in python -

sep = '...'
stripped = text.split(sep, 1)[0]

Comments

Submit
0 Comments